package com.cjh.springboot.dao;

import com.cjh.springboot.entity.DiscussPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface DiscussPostMapper {
    /*
    显示所有是userID的数据，从offset行开始，显示limit条数据
     */
    List<DiscussPost> selectDiscussPost(@Param("userId") int userId , @Param("offset")int offset, @Param("limit") int limit) ;

    int selectDiscussPostRows(@Param("userId") int userId);

    int insertDiscussPost(@Param("discussPost")DiscussPost discussPost);

    DiscussPost selectDiscussPostById(@Param("id")int id);

    int updateCommentCount(@Param("id")int id, @Param("commentCount")int commentCount);
}
